divide a value by all values in a list

31

divide a value by all values in a list -

import numpy as np
myList = [10, 20, 30, 40, 50, 60, 70, 80, 90]
myInt = 10
newList  = np.divide(myList, myInt)

python divide all values in list -

numbers = [1, 2, 3]

quotients = []

for number in numbers:

    quotients.append(number / 2)

Comments

Submit
0 Comments